import Layout from "@/layout/index.vue";
import { createNameComponent } from "../createNode";
import {
  DocumentCopy,
  Avatar,
  Tickets,
  Box,
  Share,
  GoodsFilled,
} from "@element-plus/icons-vue";

const route = [
  {
    path: "/pages",
    component: Layout,
    redirect: "/pages/crudTable",
    meta: {
      title: "管理",
      icon: DocumentCopy,
    },
    alwayShow: true,
    children: [
      {
        path: "user",
        component: createNameComponent(() =>
          import("@/views/main/pages/User.vue")
        ),
        meta: {
          title: "会员",
          cache: false,
          icon: Avatar,
        },
      },
      {
        path: "indent",
        component: createNameComponent(() =>
          import("@/views/main/pages/indent.vue")
        ),
        meta: {
          title: "订单",
          cache: false,
          icon: Tickets,
        },
      },
      {
        path: "classify",
        component: createNameComponent(() =>
          import("@/views/main/pages/Classify.vue")
        ),
        meta: {
          title: "分类",
          cache: false,
          icon: Share,
        },
      },
      {
        path: "stock",
        component: createNameComponent(() =>
          import("@/views/main/pages/Stock.vue")
        ),
        meta: {
          title: "进货",
          cache: false,
          icon: Box,
        },
      },
      {
        path: "goodsadmin",
        component: createNameComponent(() =>
          import("@/views/goods/GoodsAdmin.vue")
        ),
        meta: {
          title: "商品",
          cache: false,
          icon: GoodsFilled,
        },
      },
      {
        path: "admin",
        component: createNameComponent(() =>
          import("@/views/main/pages/Super.vue")
        ),
        meta: {
          title: "系统管理员",
          cache: false,
          icon: Avatar,
        },
      },
    ],
  },
];

export default route;
